"UnlitGeneric"
{
"$basetexture" "vgui/replay/thumbnails/speedo/xspeed"
"$translucent" 1
"$ignorez" 1

$speed 0
$speed_int 0
$pastpos "[0.0 0.0 0.0]"
$pastposX .0
$pastposY .0
$currentposX .0
$currentposY .0
$subposX .0
$subposY .0
$addsvelocity 0
$initguess 1
$right 0.0
$guessholder 0.0
$ten 10
$five 5
$four 4
$three 3
$two 2
$one 1
$half 0.5
$zero 0
$playerspeed .0
$playerspeed2 .0
$frametime .0
$posx2 .0
$posy2 .0
$posz2 .0
$distmovesumtemp .0
$pastposZ .0
$currentposZ .0
$subposZ .0
$hd2 .0
$fpscount 0
$fpscap 10

Proxies
{
PlayerPosition
{
"scale" "1"
"resultVar" "$pastpos"
}
PlayerSpeed
{
"scale" "1"
"resultVar" "$playerspeed"
}
Multiply
{
"srcVar1" "$playerspeed"
"srcVar2" "$playerspeed"
"resultVar" "$playerspeed2"
}
Clamp
{
"srcVar1" "$zero"
"min" "$pastpos[0]"
"max" "$pastpos[0]"
"resultVar" "$currentposX"
}
Clamp
{
"srcVar1" "$zero"
"min" "$pastpos[1]"
"max" "$pastpos[1]"
"resultVar" "$currentposY"
}
Clamp
{
"srcVar1" "$zero"
"min" "$pastpos[2]"
"max" "$pastpos[2]"
"resultVar" "$currentposZ"
}
Subtract
{
"srcVar1" "$currentposX"
"srcVar2" "$pastposX"
"resultVar" "$subposX"
}
Subtract
{
"srcVar1" "$currentposY"
"srcVar2" "$pastposY"
"resultVar" "$subposY"
}
Subtract
{
"srcVar1" "$currentposZ"
"srcVar2" "$pastposZ"
"resultVar" "$subposZ"
}
Equals
{
"srcVar1" "$currentposX"
"resultVar" "$pastposX"
}
Equals
{
"srcVar1" "$currentposY"
"resultVar" "$pastposY"
}
Equals
{
"srcVar1" "$currentposZ"
"resultVar" "$pastposZ"
}
Multiply
{
"srcVar1" "$subposX"
"srcVar2" "$subposX"
"resultVar" "$posx2"
}
Multiply
{
"srcVar1" "$subposY"
"srcVar2" "$subposY"
"resultVar" "$posy2"
}
Multiply
{
"srcVar1" "$subposZ"
"srcVar2" "$subposZ"
"resultVar" "$posz2"
}
Add
{
"srcVar1" "$posx2"
"srcVar2" "$posy2"
"resultVar" "$distmovesumtemp"
}
Add
{
"srcVar1" "$distmovesumtemp"
"srcVar2" "$posz2"
"resultVar" "$distmovesumtemp"
}
SelectFirstIfNonZero
{
"srcVar1" "$playerspeed2"
"srcVar2" "$one"
"resultVar" "$playerspeed2"
}
SelectFirstIfNonZero
{
"srcVar1" "$distmovesumtemp"
"srcVar2" "$one"
"resultVar" "$distmovesumtemp"
}
Add
{
"srcVar1" "$posx2"
"srcVar2" "$posy2"
"resultVar" "$hd2"
}
Divide	// Determine frame time by dividing game velocity by change in position
{
"srcVar1" "$distmovesumtemp"
"srcVar2" "$playerspeed2"
"resultVar" "$frametime"
}
Divide	// Divide xy position change by the frame time to calculate velocity^2
{
"srcVar1" "$hd2"
"srcVar2" "$frametime"
"resultVar" "$addsvelocity"
}
LessOrEqual // Change initial guess to accommodate stationary jumping
{
"lessEqualVar" "$one"
"greaterVar" "$playerspeed"
"srcVar1" "$hd2"
"srcVar2" "$one"
"resultVar" "$initguess"
}
Divide // Babylonian Method to square root
{
"srcVar1" "$addsvelocity"
"srcVar2" "$initguess"
"resultVar" "$right"
}
Add
{
"srcVar1" "$initguess"
"srcVar2" "$right"
"resultVar" "$right"
}
Multiply
{
"srcVar1" "$half"
"srcVar2" "$right"
"resultVar" "$guessholder"
}
Divide
{
"srcVar1" "$addsvelocity"
"srcVar2" "$guessholder"
"resultVar" "$right"
}
Add
{
"srcVar1" "$guessholder"
"srcVar2" "$right"
"resultVar" "$right"
}
Multiply
{
"srcVar1" "$half"
"srcVar2" "$right"
"resultVar" "$guessholder"
}
Add // Stabilize and prevent edge cases at high velocity
{
"srcVar1" "$guessholder"
"srcVar2" "$half"
"resultVar" "$guessholder"
}
Add
{
"srcVar1" "$playerspeed"
"srcVar2" "$one"
"resultVar" "$playerspeed"
}
Clamp
{
"srcVar1" "$guessholder"
"min" "$zero"
"max" "$playerspeed"
"resultVar" "$guessholder"
}
Add // Limit texture fps for readability
{
"srcVar1" "$fpscount"
"srcVar2" "$one"
"resultVar" "$fpscount"
}
LessOrEqual
{
"lessEqualVar" "$speed"
"greaterVar" "$guessholder"
"srcVar1" "$fpscount"
"srcVar2" "$fpscap"
"resultVar" "$speed"
}
LessOrEqual
{
"lessEqualVar" "$fpscount"
"greaterVar" "$zero"
"srcVar1" "$fpscount"
"srcVar2" "$fpscap"
"resultVar" "$fpscount"
}
WrapMinMax // Convert speed to texture frame
{
srcVar1 "$speed"
maxVal "$ten"
resultVar "$frame"
}
}
}